﻿<UserControl x:Class="WpfApplicationExperimental.DocumentsMainDataGridViewControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:dataLayer="clr-namespace:DataAccesLayer;assembly=DataAccesLayer"
    Height="334" Width="505" xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit">
    <Grid>
        <Grid.Resources>
            <ObjectDataProvider x:Key="documentTypeDataProvider" ObjectType="{x:Type dataLayer:EmployeeDataAccesLayer}" MethodName="GetEmployees" />
  


        </Grid.Resources>
        <dg:DataGrid x:Name="DataGrid_Standard" 
                     Grid.Row="1" Grid.Column="1" 
                     AutoGenerateColumns="False"                     
                     SelectionUnit="CellOrRowHeader"
                     SelectionMode="Extended"
                     IsSynchronizedWithCurrentItem="True" 
                     RowBackground="White" 
                     AlternatingRowBackground="LightGray"                                          
                     AlternationCount="2" RowEditEnding="DataGrid_Standard_RowEditEnding">
            <dg:DataGrid.Columns>
                <dg:DataGridComboBoxColumn Header="Employees"
                                           SelectedValueBinding="{Binding id}" 
                                           SelectedValuePath="id"
                                           DisplayMemberPath="id"
                                           ItemsSource="{Binding Source={StaticResource documentTypeDataProvider}}">
                    <dg:DataGridComboBoxColumn.EditingElementStyle>
                       
                        <Style TargetType="ComboBox">
                            <Setter Property="IsEditable" Value="True" />
                            
                        </Style>
                    </dg:DataGridComboBoxColumn.EditingElementStyle>
                    
                </dg:DataGridComboBoxColumn>

                <dg:DataGridComboBoxColumn Header="Employees"
                                           SelectedValueBinding="{Binding name}"                                                                                       
                                           SelectedValuePath="name"
                                           DisplayMemberPath="name"
                                           ItemsSource="{Binding Source={StaticResource documentTypeDataProvider}}">
                    <dg:DataGridComboBoxColumn.EditingElementStyle>
                        <Style TargetType="ComboBox">
                            <Setter Property="IsEditable" Value="True" />
                        </Style>
                    </dg:DataGridComboBoxColumn.EditingElementStyle>
                </dg:DataGridComboBoxColumn>


                <!--
                <dg:DataGridComboBoxColumn Header="CurrentProduct"
                                           SelectedValueBinding="{Binding Path=CurrentProduct}"                                                                                       
                                           SelectedValuePath="ProductID"
                                           DisplayMemberPath="ProductName">
                    <dg:DataGridComboBoxColumn.ElementStyle>
                        <Style TargetType="ComboBox">
                            <Setter Property="ItemsSource" Value="{Binding Path=ProductsInCategory}" />
                        </Style>
                    </dg:DataGridComboBoxColumn.ElementStyle>
                    <dg:DataGridComboBoxColumn.EditingElementStyle>
                        <Style TargetType="ComboBox">
                            <Setter Property="ItemsSource" Value="{Binding Path=ProductsInCategory}" />
                            <Setter Property="IsEditable" Value="True" />
                        </Style>
                    </dg:DataGridComboBoxColumn.EditingElementStyle>
                </dg:DataGridComboBoxColumn>

   -->
            </dg:DataGrid.Columns>
        </dg:DataGrid>
    </Grid>
</UserControl>
